package com.cloudbroker.bcs.platform.dav.bizapi.constants.status;

/**
 * Created by lnq on 2017/1/3.
 */
public enum ChatMsgType {

    FANS(1, "粉丝"),

    MANAGE(2, "投顾"),

    ;

    private final int val;

    private final String description;

    private String toString;

    private ChatMsgType(int val, String description) {
        this.val = val;
        this.description = description;
    }

    public int getVal() {
        return val;
    }

    public String getDescription() {
        return description;
    }

    public static String getDescription(int realVal) {
        for (ClientStatus s : ClientStatus.values()) {
            if (s.getVal() == realVal) {
                return s.getDescription();
            }
        }
        return String.valueOf(realVal);
    }

    @Override
    public String toString() {
        if (null == toString) {
            toString = new StringBuilder().append("ChatMsgType[").append(val)
                    .append(':').append(description).append(']').toString();
        }
        return toString;
    }

}
